var SingleTreeEject={
        getView:function(e){
            if(typeof (e)=="object"){
                this.scope=e.scope;
                if("undefined"==typeof e.callback)e.callback="";
                this.callback=e.callback;
                if("undefined"==typeof e.winId)e.winId="";
                this.winId=e.winId;
                if("undefined"==typeof e.winTitle)e.winTitle="";
                this.winTitle=e.winTitle;
                if("undefined"==typeof e.winWidth)e.winWidth="";
                this.winWidth=e.winWidth;
                if("undefined"==typeof e.winHeight)e.winHeight="";
                this.winHeight=e.winHeight;
                if("undefined"==typeof e.winListurl)e.winListurl="";
                this.winListurl=e.winListurl;
                if("undefined"==typeof e.winFields)e.winFields="";
                this.winFields=e.winFields;
                if("undefined"==typeof e.columnModel)e.columnModel="";
                this.columnModel=e.columnModel;
                if("undefined"==typeof e.inputFormId)e.inputFormId="";
                this.inputFormId=e.inputFormId;
                if("undefined"== typeof e.select) e.select=false;//判断是不是选择框
                this.select=e.select;
            }else{
                this.scope=this;
                if("undefined"==typeof callback)callback="";
                this.callback=e;
                if("undefined"==typeof winId)winId="";
                this.winId=winId;
                if("undefined"==typeof winTitle)winTitle="";
                this.winTitle=winTitle;
                if("undefined"==typeof winWidth)winWidth="";
                this.winWidth=winWidth;
                if("undefined"==typeof winHeight)winHeight="";
                this.winHeight=winHeight;
                if("undefined"==typeof winListurl)winListurl="";
                this.winListurl=winListurl;
                if("undefined"==typeof winFields)winFields="";
                this.winFields=winFields;
                if("undefined"==typeof columnModel)columnModel="";
                this.columnModel=columnModel;
                if("undefined"==typeof inputFormId)inputFormId="";
                this.inputFormId=inputFormId;
                if("undefined"== typeof select) select=false;
                this.select=select;
            }
            var a=this.initPanel(e);
            var win=new Ext.Window({
                id:this.winId,
               // title:this.winTitle,
                iconCls : "menu-appuser",
                width:this.winWidth,
                minWidth:this.winWidth,
                height:this.winHeight,
                minHeight:this.winHeight,
                layout:"fit",
                border:false,
                maximizable:true,
                resizable:true,
                modal:true,
                items:[a],
                buttonAlign:"center",
                buttons:SingleTreeEject.buttons()
            });
            return win;
        },
        initPanel:function(obj){
            var g = new Ext.tree.TreePanel({
                region : "center",
                id : "SingleTreeRjectPanel",
                title :this.winTitle,
                collapsible : true,
                autoScroll : true,
                split : true,
                height : 500,
                width : 80,
                tbar : new Ext.Toolbar({
                    items : [ {
                        xtype : "button",
                        iconCls : "btn-refresh",
                        text : "刷新",
                        handler : function() {
                            g.root.reload();
                        }
                    }, "-", {
                        xtype : "button",
                        text : "展开",
                        iconCls : "btn-expand",
                        handler : function() {
                            g.expandAll();
                        }
                    }, "-", {
                        xtype : "button",
                        text : "收起",
                        iconCls : "btn-collapse",
                        handler : function() {
                            g.collapseAll();
                        }
                    } ]
                }),
                loader : new Ext.tree.TreeLoader({
                    url : this.winListurl
                }),
                root : new Ext.tree.AsyncTreeNode({
                    expanded : true
                }),
                rootVisible : false,
                listeners : {
                    "click" : function(f){
                        Ext.getCmp("SingleTreeRjectPanel").getSelectionModel().clearSelections();    
                        var selectVal=Ext.getCmp("SingleTreeRjectPanel").getSelectionModel().select(f);
                        if(obj.callback){
                            obj.callback(selectVal);
                         }
                    }
                }
            });
            
            return g;
        },
        close:function(){
            Ext.getCmp(this.winId).close();
        },
        buttons:function(a){
           var buttonItems=[];
           buttonItems.push({
               text:"确定",
               iconCls:"btn-ok",
               scope:this,
               handler:this.close
           });
            return buttonItems;
        }
}